# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContainerAnalysis.V1alpha1.Model.Occurrence do
  @moduledoc """
  `Occurrence` includes information about analysis occurrences for an image.

  ## Attributes

  *   `attestation` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.Attestation.t`, *default:* `nil`) - Describes an attestation of an artifact.
  *   `buildDetails` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.BuildDetails.t`, *default:* `nil`) - Build details for a verifiable build.
  *   `compliance` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.ComplianceOccurrence.t`, *default:* `nil`) - Describes whether or not a resource passes compliance checks.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time this `Occurrence` was created.
  *   `deployment` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.Deployment.t`, *default:* `nil`) - Describes the deployment of an artifact on a runtime.
  *   `derivedImage` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.Derived.t`, *default:* `nil`) - Describes how this resource derives from the basis in the associated note.
  *   `discovered` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.Discovered.t`, *default:* `nil`) - Describes the initial scan status for this resource.
  *   `dsseAttestation` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.DSSEAttestationOccurrence.t`, *default:* `nil`) - This represents a DSSE attestation occurrence
  *   `envelope` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.Envelope.t`, *default:* `nil`) - https://github.com/secure-systems-lab/dsse
  *   `installation` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.Installation.t`, *default:* `nil`) - Describes the installation of a package on the linked resource.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Output only. This explicitly denotes which of the `Occurrence` details are specified. This field can be used as a filter in list requests.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The name of the `Occurrence` in the form "projects/{project_id}/occurrences/{OCCURRENCE_ID}"
  *   `noteName` (*type:* `String.t`, *default:* `nil`) - An analysis note associated with this image, in the form "providers/{provider_id}/notes/{NOTE_ID}" This field can be used as a filter in list requests.
  *   `remediation` (*type:* `String.t`, *default:* `nil`) - A description of actions that can be taken to remedy the `Note`
  *   `resource` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.Resource.t`, *default:* `nil`) -  The resource for which the `Occurrence` applies.
  *   `resourceUrl` (*type:* `String.t`, *default:* `nil`) - The unique URL of the image or the container for which the `Occurrence` applies. For example, https://gcr.io/project/image@sha256:foo This field can be used as a filter in list requests.
  *   `sbom` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.DocumentOccurrence.t`, *default:* `nil`) - Describes a specific software bill of materials document.
  *   `sbomReference` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.SBOMReferenceOccurrence.t`, *default:* `nil`) - This represents an SBOM reference occurrence
  *   `spdxFile` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.FileOccurrence.t`, *default:* `nil`) - Describes a specific SPDX File.
  *   `spdxPackage` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.PackageInfoOccurrence.t`, *default:* `nil`) - Describes a specific SPDX Package.
  *   `spdxRelationship` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.RelationshipOccurrence.t`, *default:* `nil`) - Describes a specific relationship between SPDX elements.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time this `Occurrence` was last updated.
  *   `upgrade` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.UpgradeOccurrence.t`, *default:* `nil`) - Describes an upgrade.
  *   `vulnerabilityDetails` (*type:* `GoogleApi.ContainerAnalysis.V1alpha1.Model.VulnerabilityDetails.t`, *default:* `nil`) - Details of a security vulnerability note.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attestation => GoogleApi.ContainerAnalysis.V1alpha1.Model.Attestation.t() | nil,
          :buildDetails => GoogleApi.ContainerAnalysis.V1alpha1.Model.BuildDetails.t() | nil,
          :compliance =>
            GoogleApi.ContainerAnalysis.V1alpha1.Model.ComplianceOccurrence.t() | nil,
          :createTime => DateTime.t() | nil,
          :deployment => GoogleApi.ContainerAnalysis.V1alpha1.Model.Deployment.t() | nil,
          :derivedImage => GoogleApi.ContainerAnalysis.V1alpha1.Model.Derived.t() | nil,
          :discovered => GoogleApi.ContainerAnalysis.V1alpha1.Model.Discovered.t() | nil,
          :dsseAttestation =>
            GoogleApi.ContainerAnalysis.V1alpha1.Model.DSSEAttestationOccurrence.t() | nil,
          :envelope => GoogleApi.ContainerAnalysis.V1alpha1.Model.Envelope.t() | nil,
          :installation => GoogleApi.ContainerAnalysis.V1alpha1.Model.Installation.t() | nil,
          :kind => String.t() | nil,
          :name => String.t() | nil,
          :noteName => String.t() | nil,
          :remediation => String.t() | nil,
          :resource => GoogleApi.ContainerAnalysis.V1alpha1.Model.Resource.t() | nil,
          :resourceUrl => String.t() | nil,
          :sbom => GoogleApi.ContainerAnalysis.V1alpha1.Model.DocumentOccurrence.t() | nil,
          :sbomReference =>
            GoogleApi.ContainerAnalysis.V1alpha1.Model.SBOMReferenceOccurrence.t() | nil,
          :spdxFile => GoogleApi.ContainerAnalysis.V1alpha1.Model.FileOccurrence.t() | nil,
          :spdxPackage =>
            GoogleApi.ContainerAnalysis.V1alpha1.Model.PackageInfoOccurrence.t() | nil,
          :spdxRelationship =>
            GoogleApi.ContainerAnalysis.V1alpha1.Model.RelationshipOccurrence.t() | nil,
          :updateTime => DateTime.t() | nil,
          :upgrade => GoogleApi.ContainerAnalysis.V1alpha1.Model.UpgradeOccurrence.t() | nil,
          :vulnerabilityDetails =>
            GoogleApi.ContainerAnalysis.V1alpha1.Model.VulnerabilityDetails.t() | nil
        }

  field(:attestation, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.Attestation)
  field(:buildDetails, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.BuildDetails)
  field(:compliance, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.ComplianceOccurrence)
  field(:createTime, as: DateTime)
  field(:deployment, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.Deployment)
  field(:derivedImage, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.Derived)
  field(:discovered, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.Discovered)

  field(:dsseAttestation, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.DSSEAttestationOccurrence)

  field(:envelope, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.Envelope)
  field(:installation, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.Installation)
  field(:kind)
  field(:name)
  field(:noteName)
  field(:remediation)
  field(:resource, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.Resource)
  field(:resourceUrl)
  field(:sbom, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.DocumentOccurrence)
  field(:sbomReference, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.SBOMReferenceOccurrence)
  field(:spdxFile, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.FileOccurrence)
  field(:spdxPackage, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.PackageInfoOccurrence)
  field(:spdxRelationship, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.RelationshipOccurrence)
  field(:updateTime, as: DateTime)
  field(:upgrade, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.UpgradeOccurrence)

  field(:vulnerabilityDetails, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.VulnerabilityDetails)
end

defimpl Poison.Decoder, for: GoogleApi.ContainerAnalysis.V1alpha1.Model.Occurrence do
  def decode(value, options) do
    GoogleApi.ContainerAnalysis.V1alpha1.Model.Occurrence.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ContainerAnalysis.V1alpha1.Model.Occurrence do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
